﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Threading.Tasks;

namespace FrogEngine
{
	public class UpdateEntityService : GameEntityServiceBase<ILogical>, IUpdateEntityService
	{
		public UpdateEntityService(IEngine engine)
			: base(engine)
		{
		}

		public void Update(GameTime gameTime)
		{
            //Parallel.ForEach(this.SubscribedEntities, e => ((ILogical)e).Update(gameTime));
            foreach (var entity in SubscribedEntities)
                ((ILogical)entity).Update(gameTime);
		}
	}
}
